<!DOCTYPE html>
<html>

<head>
    <title>首页 {$site_info.site_name|default=''}</title>
    <meta name="keywords" content="{$site_info.site_seo_keywords|default=''}" />
    <meta name="description" content="{$site_info.site_seo_description|default=''}">
    <include file="public@head" />
</head>

<body class="bg-light">
    <include file="public@nav" />
    <section class="bg-white py-3">
        <div class="container">
            <div class="row">
                <div class="col-8">
                    <!-- 轮播图 -->
                    <php>
                        $top_slide_id=1;
                    </php>
                    <div id="home-carousel" class="carousel slide carousel-fade" data-ride="carousel">
                        <ol class="carousel-indicators">
                            <slides id="$top_slide_id">
                                <li data-target="#home-carousel" data-slide-to="{$key}" <if condition="$key eq 0">class="active"></if>
                                </li>
                            </slides>
                        </ol>
                        <div class="carousel-inner">
                            <slides id="$top_slide_id">
                                <div class="carousel-item <if condition=" $key eq 0 ">active</if>">
                                    <a href="{$vo.url|default='#'}" target="_blank">
                                    <img class="first-slide img-fluid" src="{:cmf_get_image_url($vo.image)}" alt="{$vo.title}">
                                    </a>
                                    <div class="container">
                                        <div class="carousel-caption p-3 text-left">
                                            <h5 class="">{$vo.title}</h5>
                                            <p>{$vo.content}</p>
                                            <p class="mb-0"><a class="btn btn-sm btn-primary" href="{$vo.url|default='#'}" role="button">了解更多</a></p>
                                        </div>
                                    </div>
                                </div>
                            </slides>
                        </div>
                        <a class="carousel-control-prev" href="#home-carousel" role="button" data-slide="prev">
                          <span class="fa fa-angle-left" aria-hidden="true"></span>
                          <span class="sr-only">Previous</span>
                        </a>
                        <a class="carousel-control-next" href="#home-carousel" role="button" data-slide="next">
                          <span class="fa fa-angle-right" aria-hidden="true"></span>
                          <span class="sr-only">Next</span>
                        </a>
                    </div>
                    <noslides id="$top_slide_id">
                        <div id="myCarousel" class="carousel slide" data-ride="carousel">
                            <ol class="carousel-indicators">
                                <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
                                <li data-target="#myCarousel" data-slide-to="1"></li>
                            </ol>
                            <div class="carousel-inner">
                                <div class="carousel-item active">
                                    <img class="first-slide img-fluid" src="/assets/dist/images/demo/1.jpg" alt="First slide">
                                    <div class="container">
                                        <div class="carousel-caption text-left">
                                            <h3>梅陇客栈回归</h3>
                                            <p>为便于华理校友交流合作，梅陇客栈按照行业，地域，年级三个属性，建立了系列校友群，均为非官方，仅为便于交流。</p>
                                            <p><a class="btn btn-sm btn-primary" href="{:cmf_url('user/login/index')}" role="button">立即注册</a></p>
                                        </div>
                                    </div>
                                </div>
                                <div class="carousel-item">
                                    <img class="second-slide img-fluid" src="/assets/dist/images/demo/2.jpg" alt="Second slide">
                                    <div class="container">
                                        <div class="carousel-caption text-left">
                                            <h3>华理校友群&华理局域网</h3>
                                            <p>为便于华理校友交流合作，梅陇客栈按照行业，地域，年级三个属性，建立了系列校友群，均为非官方，仅为便于交流。</p>
                                            <p><a class="btn btn-sm btn-primary" href="#" role="button">阅读更多</a></p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <a class="carousel-control-prev" href="#myCarousel" role="button" data-slide="prev">
                          <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                          <span class="sr-only">Previous</span>
                        </a>
                            <a class="carousel-control-next" href="#myCarousel" role="button" data-slide="next">
                          <span class="carousel-control-next-icon" aria-hidden="true"></span>
                          <span class="sr-only">Next</span>
                        </a>
                        </div>
                    </noslides>
                </div>
                <div class="col-4">
                    <div class="card">
                        <div class="card-header">
                            热门排行
                        </div>
                        <ul class="list-group list-group-flush">
                            <portal:articles limit="5" order="post.post_hits DESC" categoryIds="">
                                <php>$top=$key
                                    <3? "top3": "";</php>
                                        <li class="{$top} list-group-item text-truncate">
                                            <i>{$key+1}</i>
                                            <a title="{$vo.post_title}" href="{:cmf_url('portal/Article/index',array('id'=>$vo['id']))}">
                                   {$vo.post_title}
                                </a>
                                        </li>
                            </portal:articles>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <section class="bg-light py-4">
        <div class="container">
            <div class="text-center text-muted">
                <h5 class="">欢迎访问 {$site_info.site_name} 社区</h5>
                <p class="mb-0">
                    本社区为非官方社区，欢迎大家自由选择发言。
                    <br>网址: http://mlkz.top
                </p>
            </div>
        </div>
    </section>
    <section class="container mb-3">
        <div class="row">
            <div class="col-2">
                <div class="mb-3">
                    <a href="{:cmf_url('portal/article/add')}" class="btn btn-primary btn-block"><i class="fa fa-edit"></i> 发表新话题</a>
                </div>
                <div class="card border-0 mb-3 sticky-top">
                    <div class="card-body">
                        <p><i class="fa fa-list"></i> 所有分类</p>
                        <ul class="list-unstyled  m-0">
                            <portal:categories item="vo" order="list_order ASC">
                                <li data-id="{$vo.id}" class="pt-3 clearfix">
                                    <a href="{:cmf_url('portal/List/index',array('id'=>$vo.id))}">
                                        <empty name="$vo.more.thumbnail">
                                            <img src="/assets/dist/images/default-thumbnail.png" style="width:24px;" class="rounded" alt="{$vo.name}">
                                            <else/>
                                            <img src="{:cmf_get_image_url($vo.more.thumbnail)}" style="width:24px;" class="img-fluid rounded" alt="{$vo.name}">
                                        </empty>
                                        <span class="mx-3 text-dark" style="position:absolute;margin-top:1px;">{$vo.name}</span></a>
                                </li>
                            </portal:categories>
                        </ul>
                    </div>
                </div>
                <div class="card border-0 mb-3">
                    <div class="card-body">
                        <div class="text-center">
                            关注微信公众号
                            <br><span class="badge badge-info">新梅陇客栈</span>
                            <img src="/assets/dist/images/qrcode.jpg" class="img-fluid">
                        </div>
                    </div>
                </div>
                <div class="card border-0 mb-3">
                    <div class="card-body">
                        <h6>关于社区</h6>
                        <ul class="list-unstyled">
                            <li><a href="{:cmf_url('portal/Page/index',array('id'=>40))}">联系我们</a></li>
                            <li><a href="{:cmf_url('portal/Page/index',array('id'=>39))}">关于我们</a></li>
                            <li><a href="{:cmf_url('portal/Page/index',array('id'=>39))}">近期活动</a></li>
                        </ul>
                        <h6>快捷联系</h6>
                        <ul class="list-unstyled m-0">
                            <li><a href="tel:(+86) 159-2158-7537"><i class="fa fa-phone"></i> 159-2158-7537</a></li>
                            <li><a href="mailto:supu@vip.qq.com"><i class="fa  fa-envelope-o"></i> supu@vip.qq.com</a></li>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="col-7">
                <div class="card border-0">
                    <div class="card-body">
                        <php>
                            $where=[ 'post.create_time'=>['egt',0] ];
                        </php>
                        <ul class="list-unstyled mb-0">
                            <portal:articles order="post.published_time DESC" relation="categories" page="10" where="$where" order="post.create_time DESC" categoryIds="">
                                <li class="media">
                                    <div style="width: 42px;" class="mr-3">
                                        <empty name="$vo.user.avatar">
                                            <img src="/assets/dist/images/headicon_128.png" class="img-fluid rounded-circle" alt="{$vo.post_title}">
                                            <else/>
                                            <img src="{:cmf_get_user_avatar_url($vo.user.avatar)}" class="img-fluid rounded-circle" alt="{$vo.post_title}">
                                        </empty>
                                    </div>
                                    <div class="media-body">
                                        <h6 class="mt-0 mb-1">
                                            <a class="text-dark" href="{:cmf_url('portal/Article/index',array('id'=>$vo.id,'cid'=>$vo.category_id))}">{$vo.post_title}</a>
                                        </h6>
                                        <p class="text-muted">
                                            <empty name="$vo.user.user_nickname">
                                                {$vo.user.user_login}
                                                <else/> {$vo.user.user_nickname}
                                            </empty> 发布于 {:func_friendly_time($vo.published_time)}
                                            <foreach name="$vo.categories" item="cat">
                                                <span class="badge badge-info float-right">{$cat.name}</span>
                                            </foreach>
                                        </p>
                                        <blockquote>
                                            <php>
                                                $post_excerpt = str_replace("\n", "", strip_tags($vo['post_content'])); $post_excerpt = msubstr($post_excerpt,0,120);
                                            </php>
                                            {$post_excerpt}
                                        </blockquote>
                                    </div>
                                </li>
                                <hr style="border-top: 1px solid #f5f6f7; " class="nopadding py-2">
                            </portal:articles>
                        </ul>
                        <ul class="pagination mx-auto mb-0">
                            <page/>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="col-3 ">
                <div class="sticky-top">
                    <div class="card border-0 user-card ">
                        <img class="card-img-top" src="/assets/dist/images/card_bg.jpg" alt="Card image cap">
                        <div class="card-body">
                            <div class="text-center">
                                <div style="margin-top:-60px" class="mx-auto">
                                    <empty name="$user.avatar">
                                        <a href="{:url('user/profile/avatar')}">
                                            <img src="/assets/dist/images/headicon_128.png" class="headicon rounded-circle shadow-sm" alt="{$user.user_nickname}">
                                        </a>
                                        <else/>
                                        <a href="{:url('user/profile/center')}">
                                            <img src="{:cmf_get_user_avatar_url($user.avatar)}" class="headicon rounded-circle shadow-sm" alt="{$user.user_nickname}">
                                        </a>
                                    </empty>
                                </div>
                                <h6 class="my-2">{$user.user_nickname}</h6>
                                <p class="card-text">{$user.signature|default="这家伙有点懒，什么都没留下"}</p>
                                <if condition="$user eq false">
                                    <a class="btn btn-info btn-sm" href="{:cmf_url('user/Login/index')}">立即登录</a>
                                </if>
                            </div>
                        </div>
                    </div>
                    <if condition="$user neq false">
                        <div class="card border-0 mt-3">
                            <empty name="card">
                                <div class="card-body user-about">
                                    <h6 class="text-dark">没有名片 <small>· <a href="{:cmf_url('businesscard/card/add')}">立即添加</a></small></h6>
                                </div>
                                <else/>
                                <div class="card-body user-about">
                                    <h6 class="text-dark mb-3">我的名片 <small>· <a href="{:cmf_url('businesscard/card/edit',['id'=>$card.id])}">编辑</a></small></h6>
                                    <ul class="list-unstyled m-0">
                                        <li class="my-2"><i class="fa fa-tag"></i>标签 <a href="javascript:;">{$card.card_tags}</a></li>
                                        <li class="my-2"><i class="fa fa-book"></i>班级 <a href="javascript:;">{$card.class}</a></li>
                                        <li class="my-2"><i class="fa fa-wechat"></i>合作 <a href="javascript:;">{$card.wechat}</a></li>
                                        <li class="my-2"><i class="fa fa-envelope"></i>邮箱 <a href="javascript:;">{$card.email}</a></li>
                                        <li class="my-2"><i class="fa fa-cube"></i>工作于 <a href="javascript:;">{$card.employer}</a></li>
                                        <li class="my-2"><i class="fa fa-home"></i>居住在 <a href="javascript:;">{$card.address}</a></li>
                                        <li class="my-2"><i class="fa fa-map-marker"></i>来自于 <a href="javascript:;">{$card.from|default='未设置'}</a></li>
                                        <li><i class="fa fa-reply"></i><a href="{:cmf_url('businesscard/card/index',['id'=>$card.id])}">更多信息</a></li>
                                    </ul>
                                </div>
                            </empty>
                        </div>
                    </if>
                </div>
            </div>
        </div>
    </section>
    <!-- /container -->
    <include file="public@footer" />
    <include file="public@scripts" />
</body>

</html>